<div class="block registration-wrap">
    <h3 class="text-center" style="margin: 5px">Tạo tài khoản mới</h3>
    <hr style="margin: 5px">
<?php
    if(!empty($errors))
    {
        echo "<div class='alert alert-error'>
            <button type=\"button\" class=\"close\" data-dismiss=\"alert\">&times;</button>
            <p class='text-warning warning'>Bạn gặp một số lỗi sau</p>
            <ul class='text-error'>";
        foreach ($errors as $e)
        {
            echo "<li>{$e}</li>";
        }
        echo '</ul></div>';
    }
?>
    <form class="form-horizontal" action="<?php echo getBaseUrl($_SERVER['REQUEST_URI']) ?>" method="post">
    <div class="control-group">
        <label class="control-label" for="uname"><?php echo lang('LBL_USERNAME') ?></label>
        <div class="controls">
            <?php echo form_input(array('type' => 'text', 'name' => 'user[username]', 'id' => 'uname', 'onchange' => 'check(this.value, this.id, this)' )) ?>
        </div>
        <span></span>
    </div>
    <div class="control-group">
        <label class="control-label" for="pword"><?php echo lang('LBL_PASSWORD'); ?></label>
        <div class="controls">
            <?php echo form_input(array('type' => 'password', 'name' => 'user[password]', 'id' => 'pword')) ?>
        </div>
        <span></span>
    </div>
    <div class="control-group">
        <label class="control-label"><?php echo lang('LBL_RETYPE_PASSWORD'); ?></label>
        <div class="controls">
            <?php echo form_input(array('type' => 'password', 'name' => 'user[re_password]', 'id' => 're_pword')) ?>
        </div>
        <span></span>
    </div>
    <div class="control-group">
        <label class="control-label"><?php echo lang('LBL_EMAIL'); ?></label>
        <div class="controls">
            <?php echo form_input(array('type' => 'email', 'name' => 'user[email]', 'id' => 'email', 'onchange' => 'check(this.value, this.id, this)' )) ?><?php echo $check_username; ?>
        </div>
        <span></span>
    </div>
    <div class="control-group">
        <label class="control-label"><?php echo lang('LBL_RETYPE_EMAIL'); ?></label>
        <div class="controls">
            <?php echo form_input(array('type' => 'email', 'name' => 'user[re_email]', 'id' => 're_email')) ?>
        </div>
    </div>
    <div class="control-group">
        <label class="control-label"><?php echo lang('LBL_BIRTHDAY'); ?></label>
        <div class="controls">
            <?php echo form_input(array('type' => 'text', 'name' => 'user[DoB]', 'id' => 'DoB', 'onfocus' => 'DayOfBirth()' )) ?>
        </div>
    </div>
    <div class="control-group">
        <label class="control-label"><?php echo lang('LBL_GENDER'); ?></label>
        <div class="controls">
            <?php echo form_input(array('type' => 'radio', 'name' => 'user[sex]', 'id' => 'sex', 'value' => '1'));
				  echo lang('LBL_GENDER_DETAIL_1');?>
            <?php echo form_input(array('type' => 'radio', 'name' => 'user[sex]', 'id' => 'sex', 'value' => '2'));
				  echo lang('LBL_GENDER_DETAIL_0');?>
        </div>
    </div>
    <div class="control-group">
        <label class="control-label"><?php echo lang('LBL_CAPTCHA') ?></label>
        <div class="controls">
            <?php echo form_input(array('type' => 'text', 'name' => 'user[captcha]', 'id' => 'captcha')) ?>
        </div>
    </div>
                    <?php echo form_input(array('type' => 'submit', 
                'name' => 'register', 
                'id' => 'register', 
                'value' => lang('LBL_REGISTER'), 
                'class' => 'btn btn-primary',
                'style' => 'margin-left: 230px'
                        )
                            ); ?>
</form>  
</div>
